#!/usr/bin/env python3

# python server.py
# uv run server.py

from mcp.server import FastMCP

# server obj.
app = FastMCP("mcp-agent")


# Add an addition tool
@app.tool()
async def greeting(name: str) -> str:
    """Add two numbers"""
    return f"Hello {name}!"


# Add a dynamic greeting resource
@app.resource("greeting://{name}")
async def get_greeting(name: str) -> str:
    """Get a personalized greeting"""
    return f"Hello, {name}!"


# Add a prompt
@app.prompt()
async def greet_user(name: str, style: str = "friendly") -> str:
    """Generate a greeting prompt"""
    styles = {
        "friendly": "Please write a warm, friendly greeting",
        "formal": "Please write a formal, professional greeting",
        "casual": "Please write a casual, relaxed greeting",
    }

    return f"{styles.get(style, styles['friendly'])} for someone named {name}."


# app.run()


